<div class="order bg-main page" v-if="show">
    <div class="main containFt">
    <div class="top-nav row">
		<div class="col" :class="{'selected':nav == 1}" v-on:click="tabChange(1)">
			持仓
		</div>
		<div class="col" :class="{'selected':nav == 2}" v-on:click="tabChange(2)">
			当日挂单
		</div>
	</div>
	
	<div class="header box tc">
    	<div class="row">
    		<p class="first-col">
    			<span class="fonts-1d4" id="totalNetworth" :class="{'color-up':totalNetworth>0,'color-down':totalNetworth<0}">{{totalNetworth}}</span><br/>总市值
    		</p>
    		<p class="col">
    		    <span class="fonts-1d4" :class="{'color-up':totalPl>0,'color-down':totalPl<0}" id="totalPl">{{totalPl|pl}}</span>&nbsp;&nbsp;<span class="fonts-1d4" :class="{'color-up':totalRiskrate>0,'color-down':totalRiskrate<0}" id="totalRiskrate">{{totalRiskrate|rate}}</span><br/>总盈亏
    		</p>
    	</div>
    </div>
	<table class="tb" v-show="nav == 1">
		<thead>
			<tr>
				<th class="title">商品</th>
				<th class="t tr">盈亏</th>
				<th class="c tr">持仓/可用</th>
				<th class="c tr">成本/现价</th>
			</tr>
		</thead>
		<template v-for="order in holdOrders">
		<tr v-on:click="showTable(order)">
			<td class="tl pad-l1" :title="order.name">{{order.goodsname}}<br>{{order.goodscode}}</td>
			<td class="tr"><span :id="'hqfpl'+order.goodscode">-</span><br /><span :id="'hqrate'+order.goodscode">-</span></td>
			<td class="tr">{{order|holdNum}}<br>{{order.holdamount}}</td>
			<!--成本/现价-->
			<td class="tr pad-r1">{{order.holdprice|priceFormat(order.mindecimal)}}<br><span :id="'hqprice'+order.goodscode">{{order.issueprice|priceFormat(order.mindecimal)}}</span></td>
		</tr>
		<tr class="btn-ct" v-if="showBtnOrder == order">
			<td colspan="4">
				<div class="row">
					<a v-if="order.issuestatus == 50" class="col" @click="showForm(98,order)" :class="{'disabled':order.issuestatus != 50}"><span class="iconfont color-up">&#xe617;</span>认购</a>
					<a v-else class="col" @click="showForm(98,order)" :class="{'disabled':order.issuestatus != 53}"><span class="iconfont color-up">&#xe617;</span>挂单买入</a>
					<a class="col" @click="showForm(115,order)" :class="{'disabled':order.issuestatus != 53}"><span class="iconfont color-down">&#xe61f;</span>挂单卖出</a>
					<a class="col" @click="pickup(order)" :class="{'disabled':order.issuestatus != 53}"><span class="iconfont color-down">&#xe720;</span>提货</a>
					<a class="col" @click="hq(order)" :class="{'disabled':order.issuestatus != 53}"><span class="iconfont color-up">&#xe616;</span>行情</a>
				</div>
			</td>
		</tr>
		</template>
	</table>
	
	<table class="tb" v-show="nav == 2">
		<thead>
			<tr>
				<th class="title">商品</th>
				<th class="c">挂单价格</th>
				<th class="c">挂量/余量</th>
				<th class="t">状态/时间</th>
			</tr>
	   </thead>
		<template v-for="order in ltOrders">
		<tr v-on:click="showTable(order)">
			<td class="tl pad-l1">{{order.goodsname}}<br>{{order.goodscode}}&nbsp;{{order.direction|direct}}</td>
			<td class="tr">{{order.orderprice|priceFormat(order.mindecimal)}}</td>
			<td class="tr">{{order.orderamount}}<br />{{order.orderamount-order.tradeamount}}</td>
			<td class="tr pad-r1">{{order.orderstatus|status}}<br />{{order.ordertime|timeFmt}}</td>
		</tr>
		<tr class="btn-ct" v-if="showBtnOrder == order">
		<td colspan="4">
			<div class="row">
				<a class="col"  @click="showForm(98,order)" :class="{'disabled':order.issuestatus == 50||order.issuestatus == 55}"><span class="iconfont color-up">&#xe617;</span>买入</a>
				<a class="col" @click="cancelOrderFormShow(order)" :class="{'disabled':order.orderstatus!=49 && order.orderstatus!=55}" :orderstatus="order.orderstatus"><span class="iconfont color-down">&#xe61f;</span>撤单</a>
				<a class="col"  @click="hq(order)"><span class="iconfont color-up">&#xe616;</span>行情</a>
			</div>
		</td>
	    </tr>
		</template>
	</table>
	
	<!--挂单买入卖出-->
	<div class="pop-page pop-form" v-show="pop">
	<p class="btn bord-rad-top-3 tc">{{formTitle}}</p>
	<form class="main">
	<div class="box">
		<div class="row">
		    <label>商品名称</label><div class="col">{{form.goodsname}}</div>
		</div>
		<div class="row">
		    <label>商品代码</label><div class="col">{{form.goodscode}}</div>
		</div>
		<div class="row">
		    <label>{{formTitlePrice}}</label>
		    <div class="col">
		    	<span v-if="form.type===1">{{formPrice}}</span>
		    	<input class="ipt" type="text" v-model="formPrice" v-else/>
		    </div>
		</div>
		<div class="row" v-if="form.type==2"> 
			<template v-show="hasRange">
		    <label>价格区间</label>
		    <div class="col"><span class="color-up">{{computedDownPrice}}&lt;=价格&lt;={{computedUpPrice}}</span></div>
			</template>
		    <!--<div class="col"><i class="iconfont icon-opt" :class="{'active':priceOptionType=='up'}">&#xe8e4;</i><span class="color-up">涨停价：{{computedUpPrice}}</span></div>
		    <div class="col"><i class="iconfont icon-opt"  :class="{'active':priceOptionType=='down'}">&#xe8e4;</i><span class="color-down">跌停价：{{computedDownPrice}}</span></div>-->
		</div>
		<div class="row"><!--数量-->
		    <label>{{formTitleNum}}</label><div class="col"><input class="ipt" type="text" v-model="formNum"/></div>
		</div>
		<div class="row">
		    <label>{{formTitleNumMax}}</label><div class="col">{{form.canamount}}</div>
		</div>
		<div class="row"><!--总计-->
		    <label>{{formTitlePriceTotal}}</label>
		    <div class="col" v-if="form.type==1">
		    	{{formPrice*formNum|toFixed}}
		    </div>
		    <div class="col" v-else>
		    	{{formPrice*formNum|toFixed}}
		    </div>
		</div>
	</div>
	<div class="form-btnCt row tc">
	     <div class="col"><input type="button" class="btn-cancel bord-rad" @click="hideForm" value="取消"/></span></div>
	     <div class="col"><input type="button" class="btn bord-rad" value="确认" @click="showFormSubmit()"/></div>
	</div>
	</form>
	</div>
	
	<!--撤单-->
	<div class="pop-page pop-form" v-show="cancelOrderFormSwitch">
	<p class="btn bord-rad-top-3 tc">撤单确认</p>
	<form class="main">
	<div class="box">
		<div class="row">
		    <label>商品名称</label><div class="col">{{form.goodsname}}</div>
		</div>
		<div class="row">
		    <label>商品代码</label><div class="col">{{form.goodscode}}</div>
		</div>
		<div class="row">
		    <label>挂单价格</label><div class="col">{{formPrice}}</div>
		</div>
		<div class="row">
		    <label>挂单数量</label><div class="col">{{formNum}}</div>
		</div>
		<div class="row">
		    <label>挂单金额</label><div class="col">{{form.totalprice}}</div>
		</div>
	</div>
	<div class="form-btnCt row tc">
	     <div class="col"><input type="button" class="btn-cancel bord-rad" @click="cancelOrderFormHide" value="取消"/></span></div>
	     <div class="col"><input type="button" class="btn bord-rad" value="确认"  @click="killOrderFormSubmit"/></div>
	</div>
	</form>
	</div>
   </div> 	
   <div class="loadingCt" v-show="loading"></div>
</div>